Imports System.Data
Imports System.Drawing
Partial Class xmltest
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim tbl As Table
        Dim tblrow As TableRow
        Dim tblcell As TableCell
        Dim intRows As Integer
        Dim intCells As Integer
        Dim strColNames() As String = {"No", "Song", "Artist"}
        Dim ds As New DataSet
        ds.ReadXml(Server.MapPath("App_Data/XMLFile.xml"))
        tbl = New Table
        tbl.ID = "Table1"
        tbl.EnableViewState = False
        tbl.Caption = "Top Hits and Artists"
        tbl.Attributes.Add("summary", "A list of top songs as selected by our listeners")
        tbl.BorderWidth = 1
        tbl.BorderColor = Color.Aqua
        tbl.BackImageUrl = "img/Wallpapers - Art II - 02.jpg"
        tblrow = New TableRow
        For Each s As String In strColNames
            tblcell = New TableCell
            tblcell.Text = s
            tblrow.Cells.Add(tblcell)
        Next
        tbl.Rows.Add(tblrow)
        For intRows = 0 To ds.Tables(0).Rows.Count - 1
            tblrow = New TableRow
            tbl.Rows.Add(tblrow)
            For intCells = 0 To 2
                tblcell = New TableCell
                tblcell.Text = ds.Tables(0).Rows(intRows)(intCells)
                tblrow.Cells.Add(tblcell)
            Next
        Next
        PlaceHolder1.Controls.Add(tbl)
    End Sub

    Protected Sub btnOK_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOK.Click
        lblPass.Text = txtPass.Text
    End Sub
End Class
